package com.huaxin.device.dto.request;

import com.huaxin.device.dto.enums.validation.ValidDeviceStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class UpdateDeviceInstanceReqDTO {

    /**
     * 设备ID
     */
    @NotBlank(message = "ID不能为空")
    @Schema(description = "设备ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "123e4567-e89b-12d3-a456-426614174000")
    private String id;

    /**
     * 设备名称
     */
    @Schema(description = "设备名称", example = "厨房断路器1号")
    private String deviceName;

    /**
     * 区域ID
     */
    @Schema(description = "区域ID", example = "z123e456-789a-bcde-f012-3456789abcde")
    private String zoneId;

    /**
     * 区域名称
     */
    @Schema(description = "区域名称", example = "厨房区域")
    private String zoneName;

    @Schema(description = "设备类型", example = "设备类型：acquisition/monitoring")
    private String deviceType;
    /**
     * 状态
     */
    @NotNull(message = "状态不能为空")
    @Schema(description = "状态：online/offline/failure/deactivate/scrap", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ValidDeviceStatus
    private String status;

    /**
     * 最后心跳时间
     */
    @Schema(description = "最后心跳时间", example = "2025-08-17 16:00:00")
    private LocalDateTime lastHeartbeat;

    /**
     * 安装时间
     */
    @Schema(description = "安装时间", example = "2023-01-15 09:00:00")
    private LocalDateTime installDate;

    /**
     * 预计更换日期
     */
    @Schema(description = "预计更换日期", example = "2028-01-15")
    private String expectedReplacementDate;

    /**
     * 实际更换/报废日期
     */
    @Schema(description = "实际更换/报废日期", example = "2027-11-20")
    private String actualReplacementDate;

    /**
     * 固件版本
     */
    @Schema(description = "固件版本", example = "v2.1.5")
    private String firmwareVersion;

    /**
     * 详细安装位置
     */
    @Schema(description = "详细安装位置", example = "厨房配电箱第3排第2列")
    private String installLocation;

}